package com.baidu.shop.mapper;

import com.baidu.shop.dto.SkuDTO;
import com.baidu.shop.entity.SkuEntity;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.DeleteByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @Description:
 * @ClassName: SkuMapper
 * @Author: User
 * @date: 2020.09.08 17:51
 * @version: 1.0
 */
public interface SkuMapper extends Mapper<SkuEntity> , DeleteByIdListMapper<SkuEntity,Long> {
    @Select("select s1.*,s2.stock from tb_sku s1 , tb_stock s2 where s1.id=s2.sku_id and s1.spu_id = #{spuId}")
    List<SkuDTO> selectSkuAndStockBySpuId(Integer spuId);
}
